﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UwinEducation.Application.Dtos;
using UwinEducation.Domain.Entities;

namespace UwinEducation.Application.Mappings
{

    public class TeacherScheduleProfile : Profile
    {
        public TeacherScheduleProfile()
        {
            CreateMap<TeacherSchedule, TeacherScheduleDto>()
                .ForMember(dest => dest.CalenderColor, opt => opt.MapFrom(src => src.Course.CalendarColor))
                .ForMember(dest => dest.CourseName, opt => opt.MapFrom(src => src.Course.Name));

            CreateMap<TeacherScheduleDetails, TeacherScheduleDetailsDto>()
                .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.Id))
                .ForMember(dest => dest.StartTime, opt => opt.MapFrom(src => src.StartTime))
                .ForMember(dest => dest.EndTime, opt => opt.MapFrom(src => src.EndTime))
                .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status))
                .ForMember(dest => dest.Reason, opt => opt.MapFrom(src => src.Reason));


            //CreateMap<RolePermission, RolePermission>();

            CreateMap<BatchCreateTeacherScheduleDto, TeacherSchedule>();
            CreateMap<UpdateTeacherScheduleDto, TeacherSchedule>();

            CreateMap<TeacherSchedule, TeacherScheduleListDto>()
                .ForMember(dest => dest.Status, opt => opt.MapFrom(src => src.Status))
                .ForMember(dest => dest.Reason, opt => opt.MapFrom(src => src.Remarks));


            //CreateMap<Role, RoleDto>()
            //.ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.Name));
        }
    }
}
